package com.lcy.service.impl;

import com.lcy.dao.SmbmsUserDao;
import com.lcy.dao.impl.SmbmsUserDaoImpl;
import com.lcy.entry.SmbmsUser;
import com.lcy.service.LoginService;

public class LoginServiceImpl implements LoginService {
    @Override
    public boolean login(String userCode,String userPassword){
        System.out.println(userCode);
        System.out.println(userPassword);
        SmbmsUserDao smbmsUserDao = new SmbmsUserDaoImpl();
        SmbmsUser smbmsUser = smbmsUserDao.getSmbmsUserByUserCode(userCode);
        if (smbmsUser != null) {
            if (userPassword.equals(smbmsUser.getUserPassword())) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
}



